#include "formatter.hpp"
#include "government.hpp"
#include "government_summary_dialog.hpp"
#include "label.hpp"
#include "world.hpp"

namespace game_dialogs {

government_summary_dialog::government_summary_dialog(world& w, government_ptr g)
    : dialog(800, 0, 224, 100), world_(w), gov_(g)
{
	init();
}

void government_summary_dialog::init()
{
	clear();
	using namespace gui;
	set_padding(10);
	const SDL_Color color = { 0xFF, 0xFF, 0xFF };

	const int weather = world_.weather();
	
	add_widget(widget_ptr(new label(formatter() << "Weather: " << (weather < 0 ? "drought" : (weather > 0 ? "excellent" : "fair")), color)), 10, 10);
	add_widget(widget_ptr(new label(formatter() << "Treasury: " << gov_->treasury(), color)));
}

}
